#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    ui->lcdNumber->display(10);
//    MyThread t1;
//    MyThread t2;

//    t1.run();
//    t2.run();

//    t1.start();
//    t2.start();
//    t1.wait();
//    t2.wait();

    //qDebug() << MyThread::num;

    connect(&mt1, &MyThread::notify, this, [=](){
        int val = ui->lcdNumber->intValue();
        if(val > 0)
        {
            ui->lcdNumber->display(val-1);
        }
    });

    mt1.start();

}

Widget::~Widget()
{
    delete ui;
}

